/*
 * @Author: 李佳晶111 11238117+lijiajing-111@user.noreply.gitee.com
 * @Date: 2023-04-07 14:24:56
 * @LastEditors: 李佳晶111 11238117+lijiajing-111@user.noreply.gitee.com
 * @LastEditTime: 2023-04-07 16:29:09
 * @FilePath: \2\shop\src\router\index.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { createRouter, createWebHashHistory } from 'vue-router'
import LayOut from '../views/LayOut/LayOut'

const routes = [
  // 登陆页面
  {
    path:"/",
    name:"login",
    component:()=>import("../views/pages/login.vue")
  },
 {
    path:"/layout",
    name:"layout",
    component:LayOut,
    redirect:"/user",
    // 子路由/嵌套路由
    children:[
      {
        path:"/index",
        name:"index",
        component:()=>import("../views/pages/index.vue")
      }, 
      {
        path:"/roles",
        name:"roles",
        component:()=>import("../views/pages/rolesList.vue")
      }, 
      {
        path:"/user",
        name:"user",
        component:()=>import("../views/pages/usersList.vue")
      },
      {
        path:"/goods",
        name:"goods",
        component:()=>import("../views/pages/goodsList.vue")
      },
      {
        path:"/goodsCategory",
        name:"/goodsCategory",
        component:()=>import("../views/pages/goodsCategory.vue")
      },
      {
        path:"/echarts",
        name:"echarts",
        component:()=>import("../views/pages/echarts.vue")
      },
      {
        path:"/bill",
        name:"bill",
        component:()=>import("../views/pages/bill.vue")
      }
    ]
 }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
